#include <stdio.h>

int main(void)
{
	printf("%d\n", bar(1,10));
}

int foo(int i, int d)
{
	if(i==1)
		return d+1;
	else if(i%2==0)
		return foo(i/2, d+1);
	else
		return foo(3*i+1, d+1);
}

int bar(int a, int b)
{
	int i;
	int m = foo(a, 0);
	for(i=0; i < b-a; i++)
		m = max(m, foo(a+i+1, 0));
	return m;
}

int max(int a, int b)
{
	if(a > b)
		return a;
	return b;
}
